$(function(){
    $.ajax({
        type:'GET',
        url:'Public/plugins/gonggao/get_notice.php',
        success:function(data){
            var list=data[0];
            if(list.isshow == 1){
                $("#notice .title").html(list.title);
                $("#notice .respect").html(list.respect);
                $("#notice .content").html(list.content);
                $("#notice .author").html(list.author);
                $("#notice .notice_time").html(list.notice_time);
                if($.cookie("isClose") != list.save_cookie){
                    var winWid = $(window).width()*0.05;
                    var winHig = $(window).height()*0.05
                    var wid=$(window).width()*0.9;
                    var hig=$(window).height()*0.9;
                    $(" #notice").css({"left":winWid,"top":-hig*1.2,"width":wid,"height":hig});	//自上而下
                    $("#alert_notice").show();
                    $(" #notice").animate({"left":winWid,"top":winHig},1000);
                   // $.cookie("isClose",list.save_cookie,{ expires:1/8640});	//测试10秒
                       $.cookie("isClose",list.save_cookie,{ expires:(list.save_time*360)/8640});
                    //$.cookie("isClose",'yes',{ expires:1});		一天
                    $(".know").click(function(){
                        $("#alert_notice").fadeOut(500);
                    });
                }
            }
        },
        error:function(data){
            console.log('获取公告失败！');
        }
    });
})